package com.example.wallpaperapp.ui.activity;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.example.wallpaperapp.R;
import com.example.wallpaperapp.adapter.RecycleAdapter;
import com.example.wallpaperapp.base.BaseActivity;

import java.util.ArrayList;
import java.util.List;

public class DownloadActivity extends BaseActivity {


    private RecyclerView recyclerView;//声明RecyclerView
    private RecycleAdapter adapter;//声明适配器
    private Context context;
    private List<Integer> list;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        context = this;
        setContentView(R.layout.activity_download);

        recyclerView = (RecyclerView) findViewById(R.id.download_recyclerView);
        list = new ArrayList<Integer>();
        list.add(R.drawable.img_1);
        list.add(R.drawable.img_2);
        list.add(R.drawable.img_3);
        list.add(R.drawable.img_4);
        list.add(R.drawable.img_5);
        list.add(R.drawable.img_6);


        adapter = new RecycleAdapter(context,list);
        GridLayoutManager manager = new GridLayoutManager(this,3);
        manager.setOrientation(GridLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(manager);
        recyclerView.setAdapter(adapter);
        ImageView imageView  =(ImageView) findViewById(R.id.download_return);
        imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    protected int initLayout() {
        return R.layout.activity_download;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }
}